package com.sunxu.exercise6;

import com.sunxu.exercise4.MyThread;

/**
 * ${DESCRIPTION}
 *
 * @author Sun
 * @create 2017-08-02-13:11
 */
public class Run5 {
    public static void main(String[] args) {
        try {
            MyThread5 myThread5 = new MyThread5();
            myThread5.start();
            Thread.sleep(5000);
            // A段
            myThread5.suspend();
            System.out.println("A= " + System.currentTimeMillis() + " i=" +  myThread5.getI());
            Thread.sleep(5000);
            System.out.println("A= " + System.currentTimeMillis() + " i=" + myThread5.getI());

            // B段
            myThread5.resume();
            Thread.sleep(5000);

            // C段
            myThread5.suspend();
            System.out.println("B= " + System.currentTimeMillis() + " i=" + myThread5.getI());
            Thread.sleep(5000);
            System.out.println("B= " + System.currentTimeMillis() + " i=" + myThread5.getI());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
